gpsbabel.git
2 years agobump qt build from 6.5.2 to 6.5.3 (#1185)
tsteven4 [Fri, 29 Sep 2023 14:16:22 +0000 (08:16 -0600)]
bump qt build from 6.5.2 to 6.5.3 (#1185)

2 years agoRemove final remnants of 'exported' (#1146)
tsteven4 [Mon, 25 Sep 2023 13:48:19 +0000 (07:48 -0600)]
Remove final remnants of 'exported' (#1146)

* Remove final remnants of 'exported'

* incorporate review comments in duplicate filter,

and remove deleted exported keyword from unicsv doc.

---------

Co-authored-by: Robert Lipe <robertlipe@gmail.com>
2 years agotidy fixes (#1179)
tsteven4 [Fri, 15 Sep 2023 00:09:56 +0000 (18:09 -0600)]
tidy fixes (#1179)

* tidy readability-convert-member-functions-to-static

* tidy readability-make-member-function-const

* kill trailing space

2 years agofix various "Redundancies in code" (#1178)
tsteven4 [Thu, 14 Sep 2023 13:43:55 +0000 (07:43 -0600)]
fix various "Redundancies in code"  (#1178)

* fix "Redundant elaborted type specifier"

* fix "Redundant 'inline' specifier"

* fix "redundant 'const' specifier on a constexpr variable"

* remove "Redundant qualifier"

* add /out/, /.vs/ to .gitignore, and sort.

2 years agofix SchemaArrayField/SchemaArrayData mismatch (#1177)
tsteven4 [Thu, 14 Sep 2023 12:54:38 +0000 (06:54 -0600)]
fix SchemaArrayField/SchemaArrayData mismatch (#1177)

* fix SchemaArrayField/SchemaArrayData mismatch

related to IGC additions from #1060 and #1054.

* retire global trait collection

* use class member to store track traits instead of fs data.

* fiddle with kml accumlate hash

* compute number of wp_fields

* correct bug concerning track specific traits.

* simplify multi-track array decisions.

* simplify kml multi-track schema decisions.

2 years agoIntegrate OAT and SIU with Waypoints (#1060)
PacketFiend [Tue, 12 Sep 2023 11:28:55 +0000 (07:28 -0400)]
Integrate OAT and SIU with Waypoints (#1060)

* Integrate OAT and SIU with Waypoints

* Type corrections, convert set_value() overload to nullptr* check

* #1062 Fix core dump when merging tracks with disparate IGC extensions

* Reduce `value` variable scope when writing SimpleArrays

* Debug oopsie bugfix, fix core dump when merging IGC files with no extensions

* Collapse redundant if statement

* Fix brain fart

* Eliminate igc_fsdata::has_value()

* Fix subtle satellite count bug

* Fix small sat count bug, and eliminate some ifdefs

* Make some IGC exts override default WP members

* Include IGC line-by-line debug info

* Remove accidentally included file

* delete obsolete macros

---------

Co-authored-by: tsteven4 <13596209+tsteven4@users.noreply.github.com>
2 years agofix noreturn booboos. (#1176)
tsteven4 [Mon, 11 Sep 2023 00:01:46 +0000 (18:01 -0600)]
fix noreturn booboos. (#1176)

* fix warning: function declared ‘noreturn’ has a ‘return’ statement

* geez, another booboo using noreturn.

2 years agoMerge pull request #1175 from tsteven4/refact
tsteven4 [Sun, 10 Sep 2023 13:28:37 +0000 (07:28 -0600)]
Merge pull request #1175 from tsteven4/refact

Apply new resharper refactoring "Redundant dereferencing and taking address"

2 years agofix reserved-macro-identifier clang diagnostic
tsteven4 [Sat, 9 Sep 2023 13:44:43 +0000 (07:44 -0600)]
fix reserved-macro-identifier clang diagnostic

2 years agouse noreturn attribute
tsteven4 [Sat, 9 Sep 2023 13:32:31 +0000 (07:32 -0600)]
use noreturn attribute

2 years agodrop extra semicolons
tsteven4 [Sat, 9 Sep 2023 13:12:34 +0000 (07:12 -0600)]
drop extra semicolons

2 years agodon't use posix but non-iso argument reordering in print specifiers.
tsteven4 [Sat, 9 Sep 2023 12:59:44 +0000 (06:59 -0600)]
don't use posix but non-iso argument reordering in print specifiers.

2 years agoremove obsolete declarations
tsteven4 [Sat, 9 Sep 2023 00:18:16 +0000 (18:18 -0600)]
remove obsolete declarations

2 years agoApply new resharper refactoring "Redundant dereferencing and taking address"
tsteven4 [Fri, 8 Sep 2023 23:06:32 +0000 (17:06 -0600)]
Apply new resharper refactoring "Redundant dereferencing and taking address"

2 years agomake all but the stack filter dynamic. (#1174)
tsteven4 [Fri, 8 Sep 2023 12:34:56 +0000 (06:34 -0600)]
make all but the stack filter dynamic. (#1174)

2 years agoBump actions/checkout from 3 to 4 (#1172)
dependabot[bot] [Wed, 6 Sep 2023 14:13:05 +0000 (08:13 -0600)]
Bump actions/checkout from 3 to 4 (#1172)

Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: tsteven4 <13596209+tsteven4@users.noreply.github.com>
2 years agomkshort becomes a class (#1173)
tsteven4 [Wed, 6 Sep 2023 13:34:56 +0000 (07:34 -0600)]
mkshort becomes a class (#1173)

* make mkshort a class

* add new file mkshort.h

* refactor names

* use bools with mkshort setters

2 years agoconvert mkshort from char* to QByteArray (#1171)
tsteven4 [Mon, 4 Sep 2023 20:13:40 +0000 (14:13 -0600)]
convert mkshort from char* to QByteArray (#1171)

* convert mkshort from char* to QByteArray.

and store conflict count directly in hash.

* fix potential detach

and rename vars

* tweak whitespace removal.

* don't split codepoints that comprise a grapheme.

* enhance mkshort test

* fix enhanced test

* test mkshort replacements

* remformat mkshort with astyle

* add mkshort test to cmake

2 years agoUpdate gpsbabel_man.xml (#1170)
積丹尼 Dan Jacobson [Sun, 3 Sep 2023 18:13:24 +0000 (13:13 -0500)]
Update gpsbabel_man.xml (#1170)

Without a dash this will resemble the "tar" command!

2 years agofix mkshort unique (#1168)
tsteven4 [Fri, 1 Sep 2023 17:00:45 +0000 (11:00 -0600)]
fix mkshort unique (#1168)

* fix mkshort unique.

1. we were off by one when deciding if we could just concatentate
the generated suffix to the name, failing to use the last available
character.
2. when attempting to copy the generated suffix to a presumably
shortened name, and the generated suffix was longer than the name,
the target of the copy was outside the name buffer.  In the common
case that the rank of size_t was greater than the rank of int, the
target was well beyond the end of name, not before as one would expect
with signed arithmetic.

With the new algorithm when the target length is insufficient to
fit both the name and the suffix we will only truncate the name as
required to fit the truncated name and the complete suffix in the
target length(as opposed to the original length of the name).
We fatal if this is not possible.

Add a test case to exercise the make unique code.

* fix reference mode.

* add notes for future enhancements

* fix testcase cut and paste booboo

* refactor mkshort input from char* to QByteArray.

2 years agoconvert googletakeout format to dynamic. (#1167)
tsteven4 [Tue, 29 Aug 2023 20:39:26 +0000 (14:39 -0600)]
convert googletakeout format to dynamic. (#1167)

2 years agodelete obsolte and unused macro. (#1166)
tsteven4 [Tue, 29 Aug 2023 00:52:22 +0000 (18:52 -0600)]
delete obsolte and unused macro. (#1166)

2 years agodelete undefined declaration. (#1165)
tsteven4 [Tue, 29 Aug 2023 00:26:11 +0000 (18:26 -0600)]
delete undefined declaration. (#1165)

The declaration appeared in 6a9a05864, 7/25/2011, without a definition
or usage.

2 years agofix memory leak in mkshort from d7dfed6, 1/23/2005. (#1162)
tsteven4 [Mon, 28 Aug 2023 23:21:28 +0000 (17:21 -0600)]
fix memory leak in mkshort from d7dfed6, 1/23/2005. (#1162)

2 years agoAdd support for Google Takeout Location History (#1160)
Tyler MacDonald [Mon, 28 Aug 2023 22:31:04 +0000 (18:31 -0400)]
Add support for Google Takeout Location History (#1160)

* Add support for Google Takeout Location History

This adds support for parsing the location history provided by Google Takeout.
This makes it possible to convert a month's, year's, or your entire location
history at once instead of having to export one day's history at a time on
Google Maps.

There is documentation in the `xmldoc` folder with some examples.

It works great, but there are one, possibly two, other additions I'd like to
make in following diffs:

1. Add the ability to select date ranges. For example, I went on a road trip
   that started in the last week of February, but right now I can only select
 tracks at the resolution of a whole month.

2. Add support for the higher-resolution "roadSegment" blocks in newer
   "activitySegment" blocks. This will have to be optional as you have to
 query the Google Maps API to get lat/long, which costs money. However,
 if you're willing to pay for it, you can get great detail out of it.
 They look like this:

```
       "roadSegment": [{
          "placeId": "ChIJBdXmuuWaK4gRoiClERhZcy8",
          "duration": "76s"
        }, {
          "placeId": "ChIJ4ekNlOWaK4gRxu-moMRFo60",
          "duration": "58s"
        }, {
          "placeId": "ChIJ10qEheWaK4gRQ1T24wEuuN4",
          "duration": "58s"
        }, {
          "placeId": "ChIJe7NWfu-aK4gRFHBB6P0PMe4",
          "duration": "58s"
[...]
```

* rename variable

* this TODO is done

* now builds on focal, fix documentation

* patch -p2 < ~/testo.log

* use `&&` instead of `and` for old compilers

* don't leak objects when we skip events at exact lat/lon 0/0

* use a reference (even though the compiler would have optimized that away)

* rename to googletakeout

* fix docs

* Address code review requests

* add `googletakeout.h` to HEADERS
* convert most `#define`s to static members
* don't pollute global namespace
* rename logging functions
* convert some methods to static functions for clang-tidy
* `title_case` loop by reference instead of by index (clang-tidy)
* better use of debugging levels
* drop dead simplifiedRawPath code for now
* drop empty tracks
* default constructor for GoogleTakeoutInputStream
* add some tests that check the content of the data

Also, I found some unofficial documentation about the location history
format and added that (thanks @CarlosBergillos !)

* apply @tsteven4 's patch. thank you!!

* add license

* fix logging

* As I assigned the correct license to my code, I am skeptical that this makes a difference, but give Robert co-copyright.

* make the test more boring

* rm xml_slice

* revert constructor change from @tsteven4 's patch

* apply @tsteven4 's latest constructor

* apply @tsteven4 's latest patch -- `cmake --build . --target check` passes

---------

Co-authored-by: tsteven4 <13596209+tsteven4@users.noreply.github.com>
2 years agoretire strupper, strlower. (#1164)
tsteven4 [Mon, 28 Aug 2023 21:20:42 +0000 (15:20 -0600)]
retire strupper, strlower. (#1164)

2 years agokill tpo2 write code, which has been dead since 46676d105, 5/17/2006. (#1163)
tsteven4 [Mon, 28 Aug 2023 20:29:44 +0000 (14:29 -0600)]
kill tpo2 write code, which has been dead since 46676d105, 5/17/2006. (#1163)

2 years agointroduce clang-tidy to CI and integrate with codacy (#1071)
tsteven4 [Fri, 25 Aug 2023 17:13:17 +0000 (11:13 -0600)]
introduce clang-tidy to CI and integrate with codacy (#1071)

* add codacy clang-tidy to workflows

* attempt to run clang-tidy on ci

* update jammy image.

get rid of ppa
add clang-tidy, jq.

* fixes.

* whittle down tidy checks.

* kick out another tidy warning

2 years agoresolve maintanence issue in interpolate & resample filters. (#1161)
tsteven4 [Wed, 23 Aug 2023 16:32:23 +0000 (10:32 -0600)]
resolve maintanence issue in interpolate & resample filters. (#1161)

* resolve maintanence issue in interpolate filter.

Instead of manually creating a deep copy of the route list with
an empty waypoint list we operate on the original route list by
swapping it's waypoint list with an empty list.  This is both more
efficient and easier to maintain.

* resolve maintanence issues in resample filter.

Instead of manually creating a deep copy of the route list with
an empty waypoint list we operate on the original route list by
swapping it's waypoint list with an empty list.  This is both more
efficient and easier to maintain.

For efficient deletion use track_del_marked_wpts.

2 years agoremove obsolete files (#1158)
tsteven4 [Sun, 13 Aug 2023 12:06:38 +0000 (06:06 -0600)]
remove obsolete files (#1158)

* remove obsolete files

* delete some more obsolete files

2 years agoadjust greatcircle conversion factors, kill gcgeodist cheat. (#1156)
tsteven4 [Sun, 13 Aug 2023 11:40:00 +0000 (05:40 -0600)]
adjust greatcircle conversion factors, kill gcgeodist cheat. (#1156)

* tweak greatcircle conversions.

* modify arc-project test to use microdegrees instead of nanodegrees.

* kill unused metric prefix conversion macros.

2 years agoremove erroneous addition from #1151. (#1157)
tsteven4 [Sat, 12 Aug 2023 21:56:45 +0000 (15:56 -0600)]
remove erroneous addition from #1151. (#1157)

The need for this statement was eliminated with the introduction of
wpt_flags.marked_for_deletion.

2 years agouse efficient methods to delete trkpts in track filter. (#1155)
tsteven4 [Sat, 12 Aug 2023 11:54:23 +0000 (05:54 -0600)]
use efficient methods to delete trkpts in track filter. (#1155)

* use efficient methods to delete trkpts in track filter.

* clean up some code issues flagged by windows tools.

2 years agofix interator invalidation issue with trackfilter segment option. (#1153)
tsteven4 [Sun, 6 Aug 2023 23:23:24 +0000 (17:23 -0600)]
fix interator invalidation issue with trackfilter segment option. (#1153)

and add a test case that demonstrates the issue.

2 years agouse std::prev instead of --c.end() (#1154)
tsteven4 [Sun, 6 Aug 2023 22:59:08 +0000 (16:59 -0600)]
use std::prev instead of --c.end() (#1154)

--c.end() is not guaranteed to compile.

2 years agoIntroduce efficient member functions for deleting waypoints (#1151)
tsteven4 [Sat, 5 Aug 2023 15:57:33 +0000 (09:57 -0600)]
Introduce efficient member functions for deleting waypoints (#1151)

* Introduce efficient member functions for deleting waypoints

New functions with complexity O(n) for deleting pre-marked
waypoints are:
  WaypointList::del_wpts
  RouteList::del_wpts
  del_wpts
  route_del_wpts
  track_del_wpts

Use those functions instead of the inefficient versions
WaypointList::waypt_del
RouteList::del_wpt
waypt_del
route_del_wpt
track_del_wpt.
When these functions are using while looping over a waypoint list
the overall complexity is O(n^2).  This is because these functions
themselves amortize to O(n).

* review nits.

* tweak deletes

* use dedicated wpt deletion flag.

2 years agoReduce complexity of simplify filter (#1149)
tsteven4 [Mon, 31 Jul 2023 13:26:05 +0000 (07:26 -0600)]
Reduce complexity of simplify filter (#1149)

* fix bugs with simplify filter

1. With the length option the last point deleted took the total error
over the specified limit.

2. When computing the total error if another point is deleted it was
possible to refer to an xte record that needed to be updated due to
the deletion of one of its neighbors.

* wip on reduced complexity simplify filter.

* mimic ineheitence of new_trkseg flag in simplify filter.

* cleanup simplify header.

* work around apparent Qt5 QMap bug.

* fix shadowing issues.

* astyle

* correct spelling.

* kill Waypoint route_priority.

2 years agotime read, filter and writer operations (#1150)
tsteven4 [Sat, 29 Jul 2023 00:21:56 +0000 (18:21 -0600)]
time read, filter and writer operations (#1150)

* time read, filter and writer operations

when using -D > 0.

* take stray dog to the pound.

2 years agofix bugs with simplify filter (#1148)
tsteven4 [Fri, 28 Jul 2023 20:40:30 +0000 (14:40 -0600)]
fix bugs with simplify filter (#1148)

1. With the length option the last point deleted took the total error
over the specified limit.

2. When computing the total error if another point is deleted it was
possible to refer to an xte record that needed to be updated due to
the deletion of one of its neighbors.

2 years agoimprove correctness and speed of duplicate filter. (#1144)
tsteven4 [Tue, 25 Jul 2023 00:28:23 +0000 (18:28 -0600)]
improve correctness and speed of duplicate filter. (#1144)

* improve correctness and speed of duplicate filter.

The duplicate filter could errouneously delete points that were
not duplicates if the crc's happened to match.

waypt_del(Waypoint*) is inefficent as it requires a search of the
list to find the matching waypoint.  Support waypt_del with iterators.

* retire util_crc.cc

* improve duplicate to linear complexity

* polish new list creation.

* Remove final remnants of 'exported'

* Revert "Remove final remnants of 'exported'"

This reverts commit 6996e4d7dd4b1812f922edd2c5bd9a3d1bc6fada.

---------

Co-authored-by: Robert Lipe <robertlipe@gmail.com>
2 years agoupdate Qt 6.5.1 -> 6.5.2 in CI. (#1140)
tsteven4 [Fri, 21 Jul 2023 21:51:32 +0000 (15:51 -0600)]
update Qt 6.5.1 -> 6.5.2 in CI. (#1140)

2 years agosync test case list in CMakeLists.txt with testo.d. (#1143)
tsteven4 [Thu, 20 Jul 2023 22:48:37 +0000 (16:48 -0600)]
sync test case list in CMakeLists.txt with testo.d. (#1143)

Yes, manual syncing is suboptimal.

2 years agofix mkshort qHash return type. (#1142)
tsteven4 [Thu, 20 Jul 2023 21:07:48 +0000 (15:07 -0600)]
fix mkshort qHash return type. (#1142)

2 years agoreduce complexity of gdb waypt searchs from O(n^2) to O(n) (#1141)
tsteven4 [Thu, 20 Jul 2023 20:45:02 +0000 (14:45 -0600)]
reduce complexity of gdb waypt searchs from O(n^2) to O(n) (#1141)

* use QHash for gdb waypoint searches.

This reduces the complexity from O(n^2) to O(n).

For the reader two parallel hashes are maintained with different
keys but identical values.  This is necessary because sometimes
we want to match the name and position, and other times we just want
to match the name.

* workaround missing qHashMulti in Qt5.

and supply missing default for our qHash functions.

* fix MSVC C2666 errors due to an erroneous assumption.

In Qt6 the return type of qHash, and the type of the seed,
happens to be the same as QHash::size_type.
However, this isn't true in Qt5.

2 years agoreduce complexity of mkshort from O(n^2) to O(n). (#1139)
tsteven4 [Thu, 20 Jul 2023 17:35:25 +0000 (11:35 -0600)]
reduce complexity of mkshort from O(n^2) to O(n). (#1139)

* reduce complexity of mkshort from O(n^2) to O(n).

* add converting constructor for mkshort hash key

2 years agoDeprecate navilink, sbn, sbp. (#1138)
Robert Lipe [Wed, 19 Jul 2023 11:01:24 +0000 (06:01 -0500)]
Deprecate navilink, sbn, sbp. (#1138)

As discussed in
https://github.com/GPSBabel/gpsbabel/pull/1090
these units have long since been deprecated by their maker. We have no
known remaining users. Numerous attempts (including  phone calls and
attempt to contact via the windsurfing community) to reach the last
known users have all failed.

Buh Bye.

2 years agodeprecate wbt formats. (#1136)
tsteven4 [Tue, 18 Jul 2023 15:41:58 +0000 (09:41 -0600)]
deprecate wbt formats. (#1136)

2 years agoeliminate ppa for qlibraryinfo bug (#1135)
tsteven4 [Mon, 17 Jul 2023 19:04:43 +0000 (13:04 -0600)]
eliminate ppa for qlibraryinfo bug (#1135)

2 years agoStrptime update (#1133)
tsteven4 [Fri, 30 Jun 2023 13:26:53 +0000 (07:26 -0600)]
Strptime update (#1133)

* prepare to update strptime

* update strptime to glibc 2.37, with modifications.

* add missing cmake file.

* quiet MSVC warnings with strptime

* quiet codacy complaints about strptime

third party code

* use _strnicmp on windows

* ensure strptime works with signed enums for windows.

2 years agofix clang 15 warnings on windows (#1132)
tsteven4 [Fri, 23 Jun 2023 22:15:35 +0000 (16:15 -0600)]
fix clang 15 warnings on windows (#1132)

* fix some format specifier issues

that came to light trying to get clang to work under visual studio.

* fix another windows only warning

* fix some more wordsize issues.

2 years agoadd gnu attribute to check functions with printf like parameters. (#1129)
tsteven4 [Wed, 14 Jun 2023 11:32:03 +0000 (05:32 -0600)]
add gnu attribute to check functions with printf like parameters. (#1129)

and fix a bug revealed by the warning.

2 years agofix gdb debug (#1128)
tsteven4 [Mon, 12 Jun 2023 15:08:53 +0000 (09:08 -0600)]
fix gdb debug (#1128)

* fix gdb dbg.

* use bool literals

2 years agofix humminbird icon matching, (#1126)
tsteven4 [Sat, 10 Jun 2023 22:00:37 +0000 (16:00 -0600)]
fix humminbird icon matching, (#1126)

* fix humminbird icon matching,

eliminating one use of xasprintf.
This was broken in 6029c8267 over a decade ago.

* eliminate unnecessary xasprinf usage.

* eliminate another xasprintf usage.

* eliminate xasprintf usage.

* retire xasprintf, xvasprintf.

2 years agodrop support for filesystem access via garmin usb. (#1127)
tsteven4 [Sat, 10 Jun 2023 19:18:32 +0000 (13:18 -0600)]
drop support for filesystem access via garmin usb. (#1127)

2 years agoadd fedora 38 to CI (#1125)
tsteven4 [Sat, 10 Jun 2023 13:20:35 +0000 (07:20 -0600)]
add fedora 38 to CI (#1125)

2 years agofix nits with trackfilter (#1124)
tsteven4 [Sun, 4 Jun 2023 23:11:07 +0000 (17:11 -0600)]
fix nits with trackfilter (#1124)

* fix nits with trackfilter

* deprecate mapconverter readme.

mapconverter style file was removed in #870

* catch reference files up

2 years agoswitch some builds to Qt 6.5.1 (#1119)
tsteven4 [Thu, 25 May 2023 12:06:37 +0000 (06:06 -0600)]
switch some builds to Qt 6.5.1 (#1119)

* update some builds to Qt 6.5.1

* conditional code for QVersionNumber evolution

2 years agofix garmin serial/usb device character encoding/decoding. (#1117)
tsteven4 [Fri, 19 May 2023 19:02:45 +0000 (13:02 -0600)]
fix garmin serial/usb device character encoding/decoding. (#1117)

* attempt to use correct codec with garmin reader.

the garmin writer is unchanged as of yet.

* fix garmin writer wrt encoding.

* add garmin option to force codec.

* update serialization ref files for garmin codec option.

* fix potential overwrite bug with route/track names

in garmin writer.

* fix up for old Qt.

* correct assertion

* use static_assert to for fixed buffer size checks.

* document garmin codec option

* don't clean rtept/trkpt names for newer devices.

We clear badchars for newer devices already, effectively not
cleaning wpt names.

2 years agorefactor unicsv & xcsv date time handling (#1114)
tsteven4 [Tue, 16 May 2023 21:44:47 +0000 (15:44 -0600)]
refactor unicsv & xcsv date time handling (#1114)

* refactor unicsv date time handling.

* restrict utc option range to match Qt offsetfromutc

* move xcsv from C-style legacy time to Qt.

* fill in lower order date/time fields when parsing.

* don't return date/time if we don't have one!

* enhance xcsv date/time testing, fix bug.

* csv format date time adjustements.

use QDateTime::fromString to parse iso date times.
return invalid QTime from addhms if parsing fails entirely.

* datetime display fixes.

For the xcsv writer:
avoid priting date/time fields when there isn't a valid date/time.
when printing with am/pm use times from a 12 hour clock.
add support for printing dotnet time.
use QDateTime::toString to print ISO time.
For the xcsv and unicsv readers:
use QDateTime::fromString instead of xml_parse_time when reading
ISO datetimes.  This avoids xml_parse_times intentional odd behavior
of treating non-timezoned times as UTC.

add a test of the xcsv writer time related fields.  This only runs
in America/Denver time zone.  As setting the time zone is system
dependent the test only runs if tzselect is available.  If so it
assumes America/Denver is available.

correct documentation to give a sensible format for xcsv field GMT_TIME.

* add reference files for new test.

* silence xcsv reader conversion warnings on empty strings.

* warn on parse errors reading excel time.

* xcsv date/time fixes.

fix addhms to account for 12/24 hour clock.
don't print invalid datetimes with iso_time, iso_time_ms.

add testcases to exercise all the xcsv reader date/time flavors.

* clarify HMSL, HMSG wrt 12/24 hour clocks.

* add missing reference file.

* enhance xcsv for HMS[L|G] before or after [LOCAL|GMT]_TIME

* restore YYYYYMMDD to use UTC.

This has been broken for some time.  Mail from 2012 indicates the intent
was UTC (https://sourceforge.net/p/gpsbabel/mailman/message/29544538/)

* unicsv review catches

don't ripple into trouble with msec rounding.
pass outputs that may or may not be written as references.

* retire xcsv fields HMSG_TIME, HMSL_TIME.

This is potentially a user visible change.  It could require
users to rewrite any style files they have created that use
these fields.

These are replaced by repeated use of GMT_TIME and LOCAL_TIME.
This eliminates our pain over 12/24 hour clock issues. strptime/
strftime (as well as QTime) have distinct conversion specifiers
for hours with 12/24 hour clocks.  Our support for HMSG_TIME,
HMSL_TIME used integer conversion specifiers for hours, minutes
and seconds.  This made it difficult to decide if a 12 or 24 hour
clock should be used, and made it impossible to have reduced
precision values with 12 hour clock using an AM/PM designation.
We also always printed AM/PM designations.

* fix whitespace in serialization reference file

2 years agorestore tab when display vector formats. (#1116)
tsteven4 [Mon, 15 May 2023 19:03:47 +0000 (13:03 -0600)]
restore tab when display vector formats. (#1116)

this was lost in #1068
update reference files to be exactly what the test produces, including
exact whitespace, trailing tabs and no newline at end of file.

2 years agoadd testing for kml:dateTimeType. (#1112)
tsteven4 [Sun, 14 May 2023 20:25:04 +0000 (14:25 -0600)]
add testing for kml:dateTimeType. (#1112)

and fix a related bug.

Note that we incorrectly, for kml:dateTimeType, force values
without time zone qualifiers to UTC.
We do not test the optional gYearMonth time zone qualifer.
We do not test the optional gYear time zone qualifer.
We do not test the optional date time zone qualifer.

2 years agoworkaound curl bug in lastest windows github runner. (#1111)
tsteven4 [Sun, 14 May 2023 18:45:24 +0000 (12:45 -0600)]
workaound curl bug in lastest windows github runner. (#1111)

2 years agoupdate linux snap (#1110)
tsteven4 [Sun, 14 May 2023 15:52:42 +0000 (09:52 -0600)]
update linux snap (#1110)

* switch snap from devmode to strict.

* date first in version string

* update snap: strict, no gui, layout

2 years agocreate a snap of the cli (#1108)
tsteven4 [Sat, 13 May 2023 13:42:31 +0000 (07:42 -0600)]
create a snap of the cli (#1108)

* try to build a snap on github.

* save artifact

* add test and continuous release

* permissions

* try to get sha into snap

* try harder to get sha in

* use pre-existing source

* debug missing sha

* force version into snap instead of sha

* shorten version

* make version more sortable

* avoid dying on info display

* pipes vs ors

* more work on sha

* again sha...

2 years agorestrict osm timestamps. (#1107)
tsteven4 [Fri, 12 May 2023 15:48:24 +0000 (09:48 -0600)]
restrict osm timestamps. (#1107)

osm consumers may not accept fractional seconds, but all should
support whole seconds.
osm consumers may not accept time zone designations other than Z,
but all should support time zone designation Z.
See https://github.com/osmcode/osmium-tool/issues/267

2 years agodatetime purity. (#1102)
tsteven4 [Tue, 9 May 2023 13:12:32 +0000 (07:12 -0600)]
datetime purity. (#1102)

eliminate some QDateTime -> gpsbabel:DateTime conversions.  These
can also help performance as DateTime defaults to UTC.

eliminate some unecessary involvment of the UNIX epoch when computing
time differences.

2 years agouse QRegularExpression for xml generic tag matching. (#1099)
tsteven4 [Wed, 3 May 2023 18:55:48 +0000 (12:55 -0600)]
use QRegularExpression for xml generic tag matching. (#1099)

* use QRegularExpression for xml generic tag matching.

The kml reader now creates tracks from innerBoundryIs elements in
addition to the historic creation from outerBoundryIs elements.

* collapse kml 2.3 track elements

* const correctness improvements for xmlgeneric.

2 years agoremove C style legacy time from sbn format. (#1096)
tsteven4 [Sat, 29 Apr 2023 13:11:34 +0000 (07:11 -0600)]
remove C style legacy time from sbn format. (#1096)

2 years agoremove remnants of baroiq format. (#1095)
tsteven4 [Sat, 29 Apr 2023 12:25:11 +0000 (06:25 -0600)]
remove remnants of baroiq format. (#1095)

aka brauniger_iq.

2 years agoset timespec to UTC in new skytraq code. (#1094)
tsteven4 [Fri, 28 Apr 2023 21:37:54 +0000 (15:37 -0600)]
set timespec to UTC in new skytraq code. (#1094)

I wish Qt would default to UTC instead of Local Time!

2 years agomove skytraq away from C style legacy time. (#1092)
tsteven4 [Fri, 28 Apr 2023 21:09:21 +0000 (15:09 -0600)]
move skytraq away from C style legacy time. (#1092)

Co-authored-by: Robert Lipe <robertlipe@users.noreply.github.com>
2 years agofinish removing C style legacy time from navilink. (#1093)
tsteven4 [Fri, 28 Apr 2023 20:44:28 +0000 (14:44 -0600)]
finish removing C style legacy time from navilink. (#1093)

coverage is provided by sbp test.

2 years agomove navilink towards QDateTime (#1091)
tsteven4 [Fri, 28 Apr 2023 18:27:11 +0000 (12:27 -0600)]
move navilink towards QDateTime (#1091)

* enable navilink waypoint write test.

add rounding for round trip fidelity.
the track test has more serious mismatches.

* move navilink towards QDateTime.

reading the datalog is untested and still uses the legacy C-style
date and time library.

* use binary mode in navilink writer.

2 years agoC-style date and time -> QDateTime in wbt format. (#1090)
tsteven4 [Fri, 28 Apr 2023 16:13:29 +0000 (10:13 -0600)]
C-style date and time -> QDateTime in wbt format. (#1090)

* test wbt timestamps.

* C-style date and time -> QDateTime in wbt format.

2 years agouse Qt datetime when writing gdb header. (#1089)
tsteven4 [Fri, 28 Apr 2023 13:57:14 +0000 (07:57 -0600)]
use Qt datetime when writing gdb header. (#1089)

* use Qt datetime when writing gdb header.

* fiddle with comment on gdb header history.

2 years agoadd gnu attributes to addtional printf like functions (#1088)
tsteven4 [Wed, 26 Apr 2023 23:02:18 +0000 (17:02 -0600)]
add gnu attributes to addtional printf like functions (#1088)

* add gnu attribute for format string checks on additional functions.

* silence msvc whining about unknown attributes.

In c++17 unknown attributes should be ignored without causing an error.
But these warnings are excessive:
"warning C5030: attribute 'gnu::format' is not recognized"

2 years agoadd build date from CI. (#1087)
tsteven4 [Wed, 26 Apr 2023 17:21:59 +0000 (10:21 -0700)]
add build date from CI. (#1087)

2 years agoreorg trackfilter.h (#1086)
tsteven4 [Tue, 25 Apr 2023 21:15:47 +0000 (15:15 -0600)]
reorg trackfilter.h (#1086)

and fix some related
cppcoreguidelines-macro-usage
modernize-return-braced-init-list

2 years agohide inifile_t from users (#1085)
tsteven4 [Tue, 25 Apr 2023 20:30:42 +0000 (14:30 -0600)]
hide inifile_t from users (#1085)

* hide inifile_t from users.

* explicitly make vars have internal linkage

although since c++11 all vars declared in unnamed namespaces will
anyway.

2 years agoForgot "name" (#1081)
積丹尼 Dan Jacobson [Tue, 25 Apr 2023 05:20:33 +0000 (13:20 +0800)]
Forgot "name" (#1081)

Or maybe use capitals:
"Latitude, Longitude, Name"

I am guessing that Name is correct.

Co-authored-by: Robert Lipe <robertlipe@users.noreply.github.com>
2 years ago-x arc: Mention output is reordered! (#1082)
積丹尼 Dan Jacobson [Tue, 25 Apr 2023 02:00:53 +0000 (10:00 +0800)]
-x arc: Mention output is reordered! (#1082)

The output isn't simply filtered, but also reordered!

2 years agomodernize garmin_txt (#1080)
tsteven4 [Sun, 23 Apr 2023 21:25:58 +0000 (15:25 -0600)]
modernize garmin_txt (#1080)

* modernize garmin_txt string handling.

also:
wean from strupper.
test binding fields to the headers in the reader.
test the writer.

* demacro garmin_txt

* eliminate redundant assignments

* astyle

* use containers for garmin_txt mapping info.

* garmin_txt reader warn on unrecognized header

and retire memset.

* use some bools, change parse_date_and_time signature.

2 years agofix some readability-implict-bool-conversion tidy warnings (#1072)
tsteven4 [Sun, 23 Apr 2023 20:41:29 +0000 (14:41 -0600)]
fix some readability-implict-bool-conversion tidy warnings (#1072)

* fix some readability-implicit-bool-conversion

warnings from clang-tidy

* another implicit bool

* fix tidy modernize-use-auto

* fix google-readability-namespace-comments

2 years agostruct tm -> std::tm, memset of tm goes to {} (#1079)
tsteven4 [Sun, 23 Apr 2023 20:17:25 +0000 (14:17 -0600)]
struct tm -> std::tm, memset of tm goes to {} (#1079)

* struct tm -> std::tm, memset of tm goes to {}.

* init std::tm related variables.

tidy found found the following warnigns related to our usage of
std::tm:
cppcoreguidelines-pro-type-member-init
and std::tm*:
cppcoreguidelines-init-variables

* make GPS_D600_Get var tm automatic storage duration

and intialize it.

2 years agogb_[set|get]bit -> std::bitset (#1078)
tsteven4 [Sat, 22 Apr 2023 15:25:36 +0000 (09:25 -0600)]
gb_[set|get]bit -> std::bitset (#1078)

2 years agofix kml cppcheck warnings. (#1077)
tsteven4 [Fri, 21 Apr 2023 21:36:38 +0000 (15:36 -0600)]
fix kml cppcheck warnings. (#1077)

Operator '|' with one operand equal to zero is redundant.

2 years agofix some MISRA 20.7 warnings (#1076)
tsteven4 [Fri, 21 Apr 2023 19:04:44 +0000 (13:04 -0600)]
fix some MISRA 20.7 warnings (#1076)

* fix some cppcheck warnings MISRA 20.7

and use QStringView in gdb writer routines.

* migrate gdb macros to static constexpr.

* name gdb constants per google style guidelines.

2 years agokeep gdb route point names and waypoint names aligned. (#1075)
tsteven4 [Fri, 21 Apr 2023 15:51:54 +0000 (09:51 -0600)]
keep gdb route point names and waypoint names aligned. (#1075)

This used to work in 1.4.4, but stopped working with the conversion
to QString (NEW_STRINGS).

Add a test case to verify the names match.

2 years agointroduce route_head::empty() (#1074)
tsteven4 [Fri, 21 Apr 2023 00:07:54 +0000 (18:07 -0600)]
introduce route_head::empty() (#1074)

2 years agoexercise qt 6.5.0 on macos CI (#1073)
tsteven4 [Thu, 20 Apr 2023 19:21:41 +0000 (13:21 -0600)]
exercise qt 6.5.0 on macos CI (#1073)

2 years agofix cppcheck constVariable warnings (#1070)
tsteven4 [Wed, 19 Apr 2023 00:44:22 +0000 (18:44 -0600)]
fix cppcheck constVariable warnings (#1070)

* fix cppcheck constVariable warnings.

* guard against qt container detachement.

2 years agouse c++ style attribute syntax with gnu namespace. (#1069)
tsteven4 [Sun, 16 Apr 2023 15:32:46 +0000 (09:32 -0600)]
use c++ style attribute syntax with gnu namespace. (#1069)

* use c++ style attribute syntax with gnu namespace.

cppcheck 2.10.3 seems to have difficulty combining c++ style
attributes like [[noreturn]] with gnu __attribute__ syntax.
this leads to lots of false positive [nullPointerRedundantCheck]
warings.

I have a feeling I did this before and it failed somewhere.  Perhaps
our compilers are all ready for it now.

* fix 7 real nullPointerRedundantCheck warnings.

and
7 nullPointerArithmeticRedundantCheck warnings
1 redundantInitialization warning
1 unreadVariable warning

* fix 1 nullPointerRedundantCheck.

A more involved fix would be to pass a reference to a non-const
parameter to mkshort_del_handle to be used as an in-out parameter.

* fix 1 nullPointerRedundantCheck

* workaround cppcheck bug with noretun.

2 years agode-duplicate format and filter vector display code. (#1068)
tsteven4 [Fri, 14 Apr 2023 13:57:20 +0000 (07:57 -0600)]
de-duplicate format and filter vector display code. (#1068)

* de-duplicate format and filter vector display code.

* consolidate release of argument memory in vecs, filter_vecs.

2 years agoadd support for dynamic filters (#1008)
tsteven4 [Thu, 13 Apr 2023 21:33:18 +0000 (15:33 -0600)]
add support for dynamic filters (#1008)

* support dynamic filters.

* delete static ResampleFilter.

* make some more filters dynamic.

* parrot Vecs::find_vec in FilterVecs::find_filter_vec.

---------

Co-authored-by: Robert Lipe <robertlipe@users.noreply.github.com>
2 years agouse constexpr if for trackfilter debug (#1067)
tsteven4 [Thu, 13 Apr 2023 01:33:27 +0000 (19:33 -0600)]
use constexpr if for trackfilter debug (#1067)

Co-authored-by: Robert Lipe <robertlipe@users.noreply.github.com>
2 years agoreference/paris.wpo was part of Holux-gm100 and no longer needed.
Robert Lipe [Thu, 13 Apr 2023 01:26:10 +0000 (20:26 -0500)]
reference/paris.wpo was part of Holux-gm100 and no longer needed.

2 years agoRemove holux gm-100 format. (#1065)
GPSBabel [Thu, 13 Apr 2023 00:35:51 +0000 (19:35 -0500)]
Remove holux gm-100 format. (#1065)

Following through with plan announced Feb 28, 2022.

This was a serial unit from the turn of the century. Holux is out of business.
We've done nothing but mechanical maintenance on this format for years.

Co-authored-by: Robert Lipe <robertlipe@users.noreply.github.com>
2 years agoRemoving baroiq and cambridge formats. (#1066)
GPSBabel [Thu, 13 Apr 2023 00:35:23 +0000 (19:35 -0500)]
Removing baroiq and cambridge formats. (#1066)

* Remove Cambridge and Baroiq formats as per Feb 28 RFC.

2 years agoMake locale debugging a compile-time constexpr debug instead of #ifdef. (#1011)
Robert Lipe [Wed, 12 Apr 2023 22:51:17 +0000 (17:51 -0500)]
Make locale debugging a compile-time constexpr debug instead of #ifdef. (#1011)

* Make locale debugging a compile-time constexpr debug instead of #ifdef.

* Ignore *.a in git so a branch change work more effortlessly on MacOS. (Yeah, not part of this CL...)

Co-authored-by: GPSBabel <12013583+GPSBabelDeveloper@users.noreply.github.com>
2 years agoUpdate interpolate-time.xml (#1021)
積丹尼 Dan Jacobson [Wed, 12 Apr 2023 22:47:46 +0000 (23:47 +0100)]
Update interpolate-time.xml (#1021)

Important to explicitly show fractional seconds are OK.

Co-authored-by: Robert Lipe <robertlipe@users.noreply.github.com>